﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using SharingCenter.Web.Classes.enums;

namespace SharingCenter.Web.Classes
{
    public class SharedUserControl : UserControl
    {
        protected Guid _contextId;
        protected string _cssClass;
        protected EntityType _entity;


        public Guid ContextId
        {
            get
            {
                try
                {
                    return (Guid)ViewState["ContextId"];
                }
                catch { return new Guid(); }
            }
            set
            {
                ViewState["ContextId"] = value;
                _contextId = value;
            }
        }
        public string CssClass { get { return (string)ViewState["CssClass"]; } set { ViewState["CssClass"] = value; } }
        public EntityType EntityType { 
            get 
            {
                try
                {
                    return (EntityType)ViewState["EntityType"];
                }
                catch
                {
                    return _entity;
                }
            } 
            set { _entity = value; ViewState["EntityType"] = value; } }
    }
}
